<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录结果</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    if (username.startsWith("a") && password.length() > 6) {
        session.setAttribute("isLogin","OK");
        session.setAttribute("username",username);
        response.sendRedirect("index.jsp");
    } else {
        request.setAttribute("msg","用户名密码错误");
        request.getRequestDispatcher("login.jsp").forward(request,response);
    }
%>
</body>
</html>
